package com.itheima.demo;
/*
* 方法重载
* 在同一个类中
* 1, 方法名相同
* 2,参数类型不同
* 3,参数个数不同
* */
public class Method6 {
    public static void main(String[] args) {
        System.out.println(compare(10, 20));
        System.out.println(compare(10L,20L));
        System.out.println(compare((byte) 10, (byte) 20));
        System.out.println(compare((short)10,(short)20));
    }

    public static boolean compare(int a, int b) {
        return a==b;
    }
    public static boolean compare(long a, long b) {
        return a==b;
    }
    public static boolean compare(byte a, byte b) {
        return a==b;
    }
    public static boolean compare(short a, short b) {
        return a==b;
    }
}
